#include "respondfactory.h"

RespondFactory::RespondFactory(QString enc) : CodecFactory()
{
    m_encStr = enc;
    m_info = NULL;
}

RespondFactory::RespondFactory(RespondInfo *info) : CodecFactory()
{
    m_encStr = QString();
    m_info = info;
}

RespondFactory::~RespondFactory()
{

}

Codec *RespondFactory::createCodec()
{
    Codec* codec = NULL;
    if(m_info)
    {
        codec = new RespondCodec(m_info);
    }
    else
    {
        codec = new RespondCodec(m_encStr);
    }
    return codec;
}
